//
//  SBPageController.h
//  Pods
//
//  Created by 刘 真 on 7/19/16.
//
//

#import <UIKit/UIKit.h>

@class SBPageController;

@protocol SBPageControllerDataSource <NSObject>

@required

- (nullable UIViewController *)pageController:(nonnull SBPageController *)pageController viewControllerBeforeViewController:(nonnull UIViewController *)viewController;

- (nullable UIViewController *)pageController:(nonnull SBPageController *)pageController viewControllerAfterViewController:(nonnull UIViewController *)viewController;

/**
 *  当前页面的索引值
 *
 *  @param pageViewController pageViewController
 *
 *  @return 当前页面的索引值
 */
- (NSInteger)presentationIndexForPageViewController:(nonnull UIPageViewController *)pageViewController;

/**
 *  返回子页的数量
 *
 *  @param pageViewController pageViewController
 *
 *  @return 子页的数量
 */
- (NSInteger)presentationCountForPageViewController:(nonnull SBPageController *)pageViewController;

@end

@interface SBPageController : UIViewController <SBPageControllerDataSource>

- (void)setViewController:(nonnull UIViewController *)viewController;

/**
 *  子类重写该方法，默认不做作何事情
 */
- (void)childDidAppear:(nonnull UIViewController *)child;


- (void)childDidScrollOffset:(CGFloat)offset;

/**
 *  移动到下一个
 */
- (void)moveNext;

/**
 *  移动到前一个
 */
- (void)moveBefore;

@end
